package com.harvest.scientific.ladder.util

import android.content.Context
import android.text.TextUtils
import com.harvest.scientific.ladder.base.ApGlobals
import java.util.UUID

object DeUtil {

    fun getDeviceId(): String? {
        val pref = ApGlobals.get().getSharedPreferences("deviceId", Context.MODE_PRIVATE)
        var uniqueId = pref.getString("deviceId", "")
        if (TextUtils.isEmpty(uniqueId)) {
            uniqueId = UUID.randomUUID().toString()
            pref.edit().putString("deviceId", uniqueId).apply()
        }
        return uniqueId
    }

}